﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MusicMaker
{
    public class Channel
    {
        //通道内的Pattern列表
        public List<Pattern> PatternList = new();

        //这个通道负责演奏什么乐器
        public int InstrumentId;

        //通道的音量是多少
        public int Volume;

        //是否独奏
        public bool IsSolo;

        //是否静音
        public bool IsSilence;

        /*
         Channel格式
        channel(ins_id, volume)[
        pattern 1
        pattern 2
        ...
        pattern n
        ]
         */
        public override string ToString()
        {
            string head = string.Format("channel({},{})", InstrumentId, Volume);
            string body = "";
            body += "[\n";
            foreach(Pattern pattern in PatternList)
            {
                body += pattern.ToString() + "\n";
            }
            body += "]";
            return head + body;
        }
    }
}
